home *** CD-ROM | disk | FTP | other *** search
/ Aminet 32 / Aminet 32 (1999)(Schatztruhe)[!][Aug 1999].iso / Aminet / dev / lang / Python152_Src.lha / Python152_Source / Modules / config.c < prev    next >
C/C++ Source or Header  |  1999-04-27  |  3KB  |  120 lines

  1.  
  2. /* Module configuration */
  3.  
  4. /* This file contains the table of built-in modules.
  5.    See init_builtin() in import.c. */
  6.  
  7. /**** I.J. 11/11/1995 ***/
  8. /* On the Amiga, you'll have to edit this file by hand to set up the *
  9. /* modules configuration (sorry)                       */
  10. /* Updated  8-dec-96 for Python 1.4                    */
  11. /* Updated 12-jan-98 for Python 1.5                    */
  12. /* Updated 25-dec-98 for I-Net225                      */
  13. /* Updated 25-apr-99 for Python 1.5.2                  */
  14. /*                (added sha, removed timing)          */
  15. /*******************************************************/
  16.  
  17.  
  18. #include "Python.h"
  19.  
  20. /* special 'safe' init functions - they check library availabilities */
  21.  
  22. static void initpwd_check(void)
  23. {
  24.     if(!checkusergrouplib()) return;
  25.     initpwd();
  26. }
  27.  
  28. static void initgrp_check(void)
  29. {
  30.     if(!checkusergrouplib()) return;
  31.     initgrp();
  32. }
  33.  
  34. static void initcrypt_check(void)
  35. {
  36.     if(!checkusergrouplib()) return;
  37.     initcrypt();    
  38. }
  39.  
  40. static void initsyslog_check(void)
  41. {
  42.     if(!checksocketlib()) return;
  43.     initsyslog();
  44. }
  45.  
  46. static void initsocket_check(void)
  47. {
  48.     if(!checksocketlib()) return;
  49.     initsocket();
  50. }
  51.  
  52. static void initselect_check(void)
  53. {
  54.     if(!checksocketlib()) return;
  55.     initselect();
  56. }
  57.  
  58.  
  59.  
  60. struct _inittab _PyImport_Inittab[] = {
  61.  
  62. /************ HERE YOU NEED TO INSTALL ALL DESIRED MODULES!!!! **************/
  63.  
  64.     {"amiga",initamiga},
  65.     {"ARexxll",initARexx},
  66.     {"Doslib", initDoslib },
  67. //    {"execlib", initexeclib },      // XXX experimental
  68. //    {"simplegfx", initsimplegfx },  // XXX experimental
  69.  
  70.     {"array",initarray},
  71.     {"binascii",initbinascii}, 
  72.     {"cmath",initcmath},
  73.     {"math",initmath},
  74.     {"new",initnew},
  75.     {"errno",initerrno},
  76.     {"environment",initenvironment},
  77.     {"regex",initregex},
  78.     {"pcre",initpcre},
  79.     {"strop",initstrop},
  80.     {"struct",initstruct},
  81.     {"time",inittime},
  82. //    {"timing",inittiming},        // XXX obsolete
  83.     {"md5",initmd5}, 
  84.     {"soundex",initsoundex},
  85.     {"rotor",initrotor},
  86.     {"operator",initoperator},
  87.     {"cStringIO",initcStringIO},
  88.     {"cPickle",initcPickle},
  89.     {"sha",initsha},
  90. //    {"zlib",PyInit_zlib},
  91.  
  92. #if defined(AMITCP) || defined(INET225)
  93.     /* Use the lib-checking init functions defined above */
  94.     {"pwd",initpwd_check},
  95.     {"grp",initgrp_check},
  96.     {"crypt",initcrypt_check},
  97.     {"select",initselect_check},
  98.     {"socket",initsocket_check},
  99.     {"syslog",initsyslog_check},
  100. #endif
  101.  
  102. /*  {"signal",initsignal}, */
  103.  
  104. /****************************************************** I.J. 10/12/1996 *****/
  105.  
  106.     /* This module "lives in" with marshal.c */
  107.     {"marshal", PyMarshal_Init},
  108.  
  109.     /* This lives in with import.c */
  110.     {"imp", initimp},
  111.  
  112.     /* These entries are here for sys.builtin_module_names */
  113.     {"__main__", NULL},
  114.     {"__builtin__", NULL},
  115.     {"sys", NULL},
  116.  
  117.     /* Sentinel */
  118.     {0, 0}
  119. };
  120.